--- <action itemid="2405" script="RPG/sickle.lua"/>
--- Sickle maked by Kronos aka Hellboy ---
local flowers_table = {
--- [itemEx.id] = {chance = , flower_id = ,new_id = }
	[2762] = {chance = 40, flower_id = 2746, new_id = 0}, --- yellow rose
	[2763] = {chance = 40, flower_id = 2744, new_id = 0}, --- red rose
	[2764] = {chance = 40, flower_id = 2745, new_id = 0}, --- blue rose
	[2761] = {chance = 40, flower_id = 5922, new_id = 0}, --- orchid
	[2743] = {chance = 20, flower_id = 5921, new_id = 0}, --- heaven blossom
	[2740] = {chance = 50, flower_id = 2741, new_id = 0} --- moon flowers
--[[	2747, 2805	]]
}

function onUse(cid, item, frompos, item2, topos)
	local FLOWERS = nil
	FLOWERS = flowers_table[item2.itemid] or nil
	--- co sie stanie, gdy uzyje tego w bp?
	if FLOWERS ~= nil then
		if FLOWERS.chance <= math.random(100) then
			if FLOWERS.new_id ~= nil and FLOWERS.new_id ~= 0 then
				doTransformItem(item2.uid, FLOWERS.new_id)
				doDecayItem(item2.uid)
			else
				doRemoveItem(item2.uid)
			end
		end
		doPlayerAddItem(cid, FLOWERS.flower_id, 1, true)
		doSendMagicEffect(topos, CONST_ME_POFF)
		return true
	end
	return false
end